Skip to content

Comments

Glasgow | Jan-26 | Fattouma Ouannassi | Sprint 2 | Coursework#967

Open
FAprogrammerO wants to merge 5 commits intoCodeYourFuture:mainfrom
FAprogrammerO:coursework/sprint-2
Open

Glasgow | Jan-26 | Fattouma Ouannassi | Sprint 2 | Coursework#967
FAprogrammerO wants to merge 5 commits intoCodeYourFuture:mainfrom
FAprogrammerO:coursework/sprint-2

Conversation

@FAprogrammerO
Copy link

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Changelist

This project (sprint 2) focuses on learning how to use JavaScript methods.

Questions

/

@FAprogrammerO FAprogrammerO added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 13, 2026
// Finally, correct the code to fix the problem
// =============> write your new code here
function sum(a, b) {
return;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have two "return" calls within a function. That's a syntax error.

You should write the fix for this function in the block below

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing that out! I had an extra return in an earlier version, but it has been removed in the latest commit. The current function contains only one return statement.


// =============> write your explanation here
// Finally, correct the code to fix the problem
// =============> write your new code here

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix for the function should be after this line

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is indeed after the line, I just updated the comment above and then added the function below according to the instructions.

.padEnd(2, "0");

return `£${pounds}.${pence}`;
} No newline at end of file

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should call this function a number of times to check it works for different inputs

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done ✅

// =============> write your answer here
// =============> "00"

// d) What is the value assigned to num when pad is called for the last time in this program? Explain your answer

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explain your answer

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done ✅

// =============> write your answer here
// =============> num=1

// e) What is the return value assigned to num when pad is called for the last time in this program? Explain your answer

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explain your answer

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done ✅

}


const currentOutput = formatAs12HourClock("08:00");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you test this formatAs12HourClock function at other times and see if it works?

It looks like your function only works when for "08:00", it doesn't work for other times

Test PM time, Noon and midnight

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done ✅

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for your time and your effort in reviewing my PR, Could you please update the label to "complete" when you have a moment ?

calling the function  number of times to check it works for different inputs.
Adding the explanations to the answers.
 testing  this formatAs12HourClock function at other times
@netEmmanuel netEmmanuel self-assigned this Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants